CALL

Syntax: CALL address [,d1[,d2[,d3[,d4[,d5[,d6[,d7[,a0[,a1[,a2[,a3[,a4[,a5 ]]]]]]]]]]]]]
Location: QL ROM

This command allows you to call a machine code routine loaded at the specified address.

You can set the initial 68008 registers by supplying more than one parameter. Each additional parameter should be an integer value.

You cannot return values to SuperBASIC using this command, although you can return errors by setting D0 from the machine code on return.

If the machine code register D0 contains a number other than an error code (or 0) on return, the program will stop with the error 'At line '.


MINERVA NOTES:
Minerva adds the following routines:

(1) Reset machine:

CALL 390,param

Param is calculated by adding the following:

Effect                                          Value to add
Skip memory test, just clear to 0               1
Skip ROM scanning (ignore extras)               2
Alter maximum memory                            4
Default to TV mode                              8
Ignore F1..F4 (no wait)                         16
Enable dual screen mode                         128
Leave n*256 bytes between screen and SV's       n*256
Set ramtop to nK                                (n+128)*1024


Always set the new ramtop to a multiple of 64K and do not try to allocate more memory than is in the system.

If you leave space between the screen and System Variables, this will reduce the amount of memory available accordingly!!


(2) Move memory quickly:
CALL PEEK_W(344)+16384,length,2,3,4,5,6,7,dest,source

This command allows you to move length bytes from the source address to the destination address (dest).

Either source or dest may be odd addresses, and the code will even cope with overlapping areas.

Example:
To copy the whole of the main screen to a screen storage area pointed to by the variable scr_store

10 scr_size=SCR_LLEN*SCR_YLIM
20 scr_store=ALCHP(scr_size)
30 CALL PEEK_W(344)+16384,scr_size,2,3,4,5,6,7,scr_store,SCR_BASE


(3) Clear memory quickly:
CALL PEEK_W(360)+16384,length,2,3,4,5,6,7,address

Clear length bytes from the given start address onwards.

Please note that address may be odd.

CROSS-REFERENCE:
LBYTES, SBYTES can be used to load and save areas of memory (and machine code routines).
ALCHP and RESPR can be used to set aside areas of memory for user routines.
BMOVE and similar commands allow you to move areas of memory on other ROM implementations.
